package com.bls.service.impl;

import com.bls.action.BLSAction;
import com.bls.dao.DraftDao;
import com.bls.dao.G4Dao;
import com.bls.entity.G4;
import com.bls.entity.query.DraftQuery;
import com.bls.entity.vo.DraftVo;
import com.bls.remote.service.CoreRemoteService;
import com.bls.service.G4Service;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

/**
 * (G4)表服务实现类
 *
 * @author makejava
 * @since 2022-01-10 18:43:20
 */
public class G4ServiceImpl implements G4Service {
    @Override
    public List<G4> pageConditionG4List(G4 g4, Integer pageSize, Integer currentPage) throws Exception {
        G4Dao g4Dao = BLSAction.getBean(G4Dao.class);
        final Connection connection = BLSAction.getDBConnection();
        List<G4> g4List = null;
        try {
            g4List = g4Dao.pageConditionG4List(connection, g4, pageSize, currentPage);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return g4List;
    }

    @Override
    public Integer pageConditionG4Total(G4 g4Query) throws Exception{
        G4Dao g4Dao = BLSAction.getBean(G4Dao.class);
        final Connection connection = BLSAction.getDBConnection();
        int count = -1;
        try {
            count = g4Dao.pageConditionG4Total(connection, g4Query);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return count;
    }
}